class AdvSearchController < ApplicationController

  def search
    @total = 0; @results = nil
    @model_title =  ( not params[:model_name].nil? ) ? params[:model_name]: params[:model][:name] rescue return
    @query = params[:query] rescue return
    @total, @results = eval(@model_title).full_text_search(@query, :page => (params[:page]||1))          
    @pages = pages_for(@total)
  end

end
